<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;

/**
 * 全局配置组件
 * @method static ConfigProvider make(string $theme = null) ConfigProvider组件
 */
class ConfigProvider extends Schema
{
    protected string $componentName = "NConfigProvider";

    public function __construct(string $theme = null)
    {
        parent::__construct();
        $this->theme($theme);
    }

    /**
     * 主题设置
     * @param string|null $theme
     * @return $this
     */
    public function theme(string $theme = null): ConfigProvider
    {
        return $this->prop('theme', $theme);
    }

    /**
     * 主题设置
     * @param string|array|null $themeOverrides
     * @return $this
     */
    public function themeOverrides(string|array|null $themeOverrides = null): ConfigProvider
    {
        return $this->prop('theme-overrides', $themeOverrides);
    }


}
